package cn.iocoder.yudao.module.travel.dal.mysql.travel1;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.travel.dal.dataobject.travel1.TravelDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.travel.controller.admin.travel1.vo.*;

/**
 * 用户基本信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface TravelMapper extends BaseMapperX<TravelDO> {

    default PageResult<TravelDO> selectPage(TravelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TravelDO>()
                .eqIfPresent(TravelDO::getUserId, reqVO.getUserId())
                .eqIfPresent(TravelDO::getPhoneNumber, reqVO.getPhoneNumber())
                .eqIfPresent(TravelDO::getPassword, reqVO.getPassword())
                .eqIfPresent(TravelDO::getIdCard, reqVO.getIdCard())
                .likeIfPresent(TravelDO::getName, reqVO.getName())
                .likeIfPresent(TravelDO::getNickname, reqVO.getNickname())
                .eqIfPresent(TravelDO::getAvatar, reqVO.getAvatar())
                .eqIfPresent(TravelDO::getGender, reqVO.getGender())
                .eqIfPresent(TravelDO::getBalance, reqVO.getBalance())
                .betweenIfPresent(TravelDO::getRegisterTime, reqVO.getRegisterTime())
                .betweenIfPresent(TravelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TravelDO::getUserId));
    }

}